<?php 

include '../../function.php';

if($_POST){

	$data = $_POST;

	if(empty($_POST['username'])){
		error('用户名没填','./index.php',4);
		exit;
	}

	if(empty($_POST['content'])){
		error('内容没填','./index.php',4);
		exit;
	}
	
	
	$data['create_time']=time();

	$db = include './db.php';

	$db[]=$data;

	$db = var_export($db,true);

	$db = "<?php return ".$db."?>";

	file_put_contents('./db.php', $db);

	header("Location:./index.php");

}else{
	error('非法请求，需要通过首页表单提交','./index.php',4);
}






 ?>